package com.example.io;


import com.example.domain.Student;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/*
*
* 序列化
*
* */
public class Test04 {
    public static void main(String[] args) throws IOException {

        Student admin = new Student("admin", 18);

        ObjectOutputStream objectOutputStream = new ObjectOutputStream(
                new FileOutputStream("D:\\27162\\Desktop\\itheima\\untitled2\\test04.txt")
        );
        objectOutputStream.writeObject(admin);
        objectOutputStream.close();
    }
}
